<style>
#box{
    width: 100px;
    height: 100px;
    background-color: red;
}
</style>
<body>
<!-- 功能按键的判断
键盘一般加给能够获取焦点的元素 -->
<div id="box"></div>

</body>
    <script>
var obox = document.getElementById('box')

    window.onkeydown = function(eve){
        var e = eve || window.event;


        
        console.log(e.keyCode)
        conso.log(e.ctrlKey);
    }

    </script>